package com.ruoyi.system.mapper;

import com.ruoyi.common.core.domain.DTO.*;
import com.ruoyi.common.core.domain.entity.PurchaseRecords;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.math.BigDecimal;
import java.util.Date;
import java.util.List;

/**
 * 参数配置 数据层
 *
 * @author ruoyi
 */
@Mapper
@Repository
public interface PurchaseRecordMapper {
    void insertPurchaseRecord(PurchaseRecords purchaseRecords);

    List<PurchaseRecordVO> selectPurchaseRecordByUserId(SelectUserPurchaseRecordBO selectUserPurchaseRecordBO);
    //管理员查看所有订单
    List<PurchaseRecordVO> selectPurchaseRecord(SelectPurchaseRecordBO selectPurchaseRecordBO);

    Long selectUserIdByOrderNo(@Param("orderNo") String orderNo);
    //更新支付时间和支付状态
    void updateByOrderNo(@Param("orderNo") String orderNo, @Param("status") Integer status,@Param("logisticsStatus") Integer logisticsStatus);

    Integer selectCountByUserIds(@Param("userIds") List<Long> userIds, @Param("startDate") Date startDate, @Param("endDate") Date endDate);

    List<DataPerformanceVO> selectByUserIds(@Param("userIds") List<Long> userIds);

    BigDecimal selectSumAmount();
    //更新快递单号
    void updateTrackingNumber(@Param("id") Long id, @Param("trackingNumber") String trackingNumber);
    //更新支付状态
    void updatePaymentStatus();
    //查询用户支付成功的订单数量
    int selectPayCountByUserId(@Param("userId") Long userId);
    //用户确认收货
    void confirmReceipt(ConfirmReceiptBO confirmReceiptBO);
}
